/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.storebits.testsystem;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Ventsi
 */
@Embeddable
public class RoomPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "roomNumber")
    private int roomNumber;
    @Basic(optional = false)
    @NotNull
    @Column(name = "hotel")
    private int hotel;

    public RoomPK() {
    }

    public RoomPK(int roomNumber, int hotel) {
        this.roomNumber = roomNumber;
        this.hotel = hotel;
    }

    public int getRoomNumber() {
        return roomNumber;
    }

    public void setRoomNumber(int roomNumber) {
        this.roomNumber = roomNumber;
    }

    public int getHotel() {
        return hotel;
    }

    public void setHotel(int hotel) {
        this.hotel = hotel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) roomNumber;
        hash += (int) hotel;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RoomPK)) {
            return false;
        }
        RoomPK other = (RoomPK) object;
        if (this.roomNumber != other.roomNumber) {
            return false;
        }
        if (this.hotel != other.hotel) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.storebits.testsystem.RoomPK[ roomNumber=" + roomNumber + ", hotel=" + hotel + " ]";
    }
    
}
